<?php
session_start();
error_reporting(0);
	// PROSES LOGIN 
		include "../include/db.class.php";
		
	$email = $_POST['email'];
	$pass  = $_POST['pass'];
		
	 global $db;
	$sql 	 = "select * from member where email='$email' and katasandi='$pass'";
	$query = $db->query($sql);
	$cekAda  = mysql_num_rows($query);
		$f 		 = mysql_fetch_array($query);
		
		if ($cekAda == 0) {
			echo "<script language='javascript'>alert('Maaf Anda belum terdaftar menjadi member kami !');</script>";
			echo "<script language='javascript'>window.location = '../sign_up.php'</script>";
		}else{
						
		//	session_register("email","pass","id_member");
			$_SESSION['email'] = $email;
			$_SESSION['pass'] = $pass;
			$_SESSION['id_member'] = $f['id_member'];
			
			echo "<script language='javascript'>window.location = '../index.php'</script>";
		}
	// AKHIR DARI PROSES LOGIN
?>